package com.none.web.model;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Activity  model,useing mapping database
 * @author Dave 20141106
 */
@Entity
@Table(name = "t_activity_appuser")
public class TActivityAppUser implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 
	 */
	
	@Id
      private String id;//UUID
      private String enroll_info;//用户报名需要填写的资料
      private Timestamp enroll_time;
      
      //活动
      private TActivity activity;
      private TUserApp appUser;//报名用户
      //private Set<TTags> tags=new HashSet<TTags>();//标签
      
      
      
   // Property accessors
    @Id
  	@Column(name = "id", unique = true, nullable = false, length = 32)
      public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "enroll_time")
	public Timestamp getEnroll_time() {
		return enroll_time;
	}
	public void setEnroll_time(Timestamp enroll_time) {
		this.enroll_time = enroll_time;
	}
	@Column(name = "enroll_info")
	public String getEnroll_info() {
		return enroll_info;
	}
	public void setEnroll_info(String enroll_info) {
		this.enroll_info = enroll_info;
	}
	
	
	
	//活动表和报名表的关系
	
	
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY)
	@JoinColumn(name = "activity_id")
	public TActivity getActivity() {
		return activity;
	}
	public void setActivity(TActivity activity) {
		this.activity = activity;
	}
	
      
   //报名表和用户的关系
	
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public TUserApp getAppUser() {
		return appUser;
	}
	public void setAppUser(TUserApp appUser) {
		this.appUser = appUser;
	}
	
	
	
  
} 
